package com.cyou.dream.define;

import lombok.Getter;

/**
 * 策略枚举，对应Yaml配置文件中的strategyId字段
 */
@Getter
public enum EStrategy {

    THROTTLING_IP_URI_RATE_LIMIT("THROTTLING_IP_URI_RATE_LIMIT"),

    EXAMPLE_PLAYER_DAILY_AWARD_LIMIT("EXAMPLE_PLAYER_DAILY_AWARD_LIMIT"),

    EXAMPLE_INCREMENT_STRATEGY("EXAMPLE_INCREMENT_STRATEGY"),

    EXAMPLE_MULTI_STEP_STRATEGY("EXAMPLE_MULTI_STEP_STRATEGY"),

    COMMON_VIRTUAL_PHONE_STRATEGY("COMMON_VIRTUAL_PHONE_STRATEGY"),

    GRAVITY_RELATION_IP_DAILY_AWARD_LIMIT("GRAVITY_RELATION_IP_DAILY_AWARD_LIMIT"),
    GRAVITY_RELATION_ANSWER_INCREMENT_STRATEGY("GRAVITY_RELATION_ANSWER_INCREMENT_STRATEGY"),
    GRAVITY_RELATION_INVITE_INCREMENT_STRATEGY("GRAVITY_RELATION_INVITE_INCREMENT_STRATEGY"),


    ;
    private final String strategyId;

    EStrategy(String strategyId) {
        this.strategyId = strategyId;
    }

    public static String of(String strategyId) {
        for (EStrategy eStrategy : EStrategy.values()) {
            if (eStrategy.strategyId.equals(strategyId)) {
                return eStrategy.name();
            }
        }
        return null;
    }

}
